package com.ruoyi.chargepile.task;

import com.ruoyi.chargepile.domain.enums.SysNoticeStatusEnum;
import com.ruoyi.system.domain.SysNotice;
import com.ruoyi.system.mapper.SysNoticeMapper;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @program: ruoyi
 * @description: 公告通知定时任务类
 * @author: XINGchi0130
 * @create: 2024-07-12 08:42
 **/
@Component("noticeTask")
public class NoticeTask {

    @Resource
    private SysNoticeMapper sysNoticeMapper;

    public void changeSysNoticeStatus(Integer sysNoticeId){
        SysNotice sysNotice = sysNoticeMapper.selectNoticeById(Long.valueOf(sysNoticeId));
        sysNotice.setStatus(SysNoticeStatusEnum.OPEN.getCode());
        sysNoticeMapper.updateNotice(sysNotice);
    }
}
